package com.xinxin.leetcode.problem674;

import com.xinxin.leetcode.common.CommonUtil;

/**
 * @author ShiXinXin
 * @date 2020-02-22 22:32
 */
public class Solution {
    public int findLengthOfLCIS(int[] nums) {
        if (nums.length == 0) {
            return 0;
        }
        int max = 1;
        int sum = 1;
        for (int i = 1; i < nums.length; i++) {
            if (nums[i] > nums[i - 1]) {
                sum++;
            } else {
                max = Math.max(max, sum);
                sum = 1;
            }
        }
        max = Math.max(max, sum);
        return max;
    }

    public static void main(String[] args) {
        System.out.println(new Solution().findLengthOfLCIS(CommonUtil.createArr(2, 2, 2, 2, 2, 2)));
    }
}
